﻿namespace A12_Ex01_2
{
    public class Program
    {
        public static void Main()
        {
            const int k_NumOfLines = 5;

            PrintRhombus(k_NumOfLines);
        }

        public static void PrintRhombus(int i_NumOfLines)
        {
            const char k_Token = '*';
            const char k_WhiteSpace = ' ';
            string outputRhombusStr = string.Empty;
            bool isEvenNumOfLines = i_NumOfLines % 2 == 0;

            if (isEvenNumOfLines)
            {
                i_NumOfLines--;
            }

            for (int i = 0; i < i_NumOfLines; i++)
            {
                int numOfSpaces = System.Math.Abs((i_NumOfLines / 2) - i);

                for (int j = 0; j < numOfSpaces; j++)
                {
                    outputRhombusStr += k_WhiteSpace;
                }

                int numOfTokens = i_NumOfLines - (2 * numOfSpaces);

                for (int k = 0; k < numOfTokens; k++)
                {
                    outputRhombusStr += k_Token; 
                }

                outputRhombusStr += System.Environment.NewLine;
            }

            System.Console.Write(outputRhombusStr);
        }
    }
}
